package com.rppowell.pixie.swing.sprite;

import com.rppowell.pixie.models.Sprite;
import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;

import com.rppowell.pixie.models.SpriteSet;
import javax.swing.JScrollPane;


public class SpriteWorkArea extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
        private SpriteCanvasPanel spriteCanvasPanel;
        private JScrollPane spriteCanvasJScrollPane;

	public SpriteWorkArea(SpriteSet s) {
                spriteCanvasPanel = new SpriteCanvasPanel();
		setLayout(new BorderLayout());
		add(new JLabel("<HTML>LEFT<BR>TOOLBAR<BR>" + s.getName()+"</HTML>"), BorderLayout.WEST);
		add(new JLabel("<HTML>RIGHT<BR>TOOLBAR<BR>" + s.getName()+"</HTML>"), BorderLayout.EAST);
		spriteCanvasJScrollPane = new JScrollPane(spriteCanvasPanel);
		//spriteCanvasJScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
		//spriteCanvasJScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);                
		add(spriteCanvasJScrollPane, BorderLayout.CENTER);
	}
        
        public void setSelectedSprite(Sprite sprite) {
            spriteCanvasPanel.setSelectedSprite(sprite);
        }
	

}
